package com.example.design.c.adapter;

/**
 * 类适配者模式
 */
public class ClassAdapterTest {

    public static void main(String[] args) {
        ITarget iTarget = new Adapter();
        iTarget.newDeal(1);
    }
}

//适配者类
class Adaptee {

    public void specificRequest(){
        System.out.println("适配者中的业务代码被调用");
    }
}

class Adapter extends Adaptee implements ITarget{


    @Override
    public void newDeal(int type) {
        specificRequest();
    }
}